package com.ibuonline.b2b.entity;

import java.io.Serializable;

public class ProdAttribute implements Serializable {

	private static final long serialVersionUID = -3524828851912067297L;

	//fields
	private java.lang.Long id;
	private java.lang.Long prodId;
	private java.lang.Integer attrId;
	private java.lang.String value;

	//default constructor
	public ProdAttribute() {
	}

	//getter
	public java.lang.Long getId() {
		return id;
	}
	public java.lang.Long getProdId() {
		return prodId;
	}
	public java.lang.Integer getAttrId() {
		return attrId;
	}
	public java.lang.String getValue() {
		return value;
	}

	//setter
	public void setId(java.lang.Long id) {
		this.id = id;
	}
	public void setProdId(java.lang.Long prodId) {
		this.prodId = prodId;
	}
	public void setAttrId(java.lang.Integer attrId) {
		this.attrId = attrId;
	}
	public void setValue(java.lang.String value) {
		this.value = value;
	}

	//equals method
	public boolean equals(Object other) {
		if (this == other)
			return true;
		if (!(other instanceof ProdAttribute))
			return false;

		final ProdAttribute prodAttribute = (ProdAttribute)other;
		if (!this.id.equals(prodAttribute.getId()))
			return false;

		return true;
	}

	//hashCode method
	public int hashCode() {
		StringBuffer keys = new StringBuffer();
		keys.append(id).append(",");
		if (keys.length() > 0)
			keys.deleteCharAt(keys.length() - 1);
		return keys.toString().hashCode();
	}

	//toString method
	public String toString() {
		return new StringBuilder("ProdAttribute[")
			.append("id=").append(id).append(", ")
			.append("prodId=").append(prodId).append(", ")
			.append("attrId=").append(attrId).append(", ")
			.append("value=").append(value).append("]").toString();
	}
	
	///###################
	private String label;
	
	private String unit;

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}
}